package sdfi.lee.Entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the user table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="user"
 */

public abstract class BaseUser  implements Serializable {

	public static String REF = "User";
	public static String PROP_PHONE = "phone";
	public static String PROP_EMAIL = "email";
	public static String PROP_PASSWORD = "password";
	public static String PROP_USERNAME = "username";
	public static String PROP_ADDRESS = "address";
	public static String PROP_LINKMAN = "linkman";
	public static String PROP_ID = "id";
	public static String PROP_COMPANY = "company";


	// constructors
	public BaseUser () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseUser (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String company;
	private java.lang.String address;
	private java.lang.String linkman;
	private java.lang.String username;
	private java.lang.String password;
	private java.lang.String email;
	private java.lang.String phone;
	private java.util.Date rgdatetime;
	private Integer ustatus;
	public Integer getUstatus() {
		return ustatus;
	}

	public void setUstatus(Integer ustatus) {
		this.ustatus = ustatus;
	}

	public java.util.Date getRgdatetime() {
		return rgdatetime;
	}

	public void setRgdatetime(java.util.Date rgdatetime) {
		this.rgdatetime = rgdatetime;
	}



	// collections
	private java.util.Set<sdfi.lee.Entity.Change> changes;

	private java.util.Set<sdfi.lee.Entity.Character> characters;

	public java.util.Set<sdfi.lee.Entity.Character> getCharacters() {
		return characters;
	}

	public void setCharacters(java.util.Set<sdfi.lee.Entity.Character> characters) {
		this.characters = characters;
	}

	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="Id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: company
	 */
	public java.lang.String getCompany () {
		return company;
	}

	/**
	 * Set the value related to the column: company
	 * @param company the company value
	 */
	public void setCompany (java.lang.String company) {
		this.company = company;
	}



	/**
	 * Return the value associated with the column: address
	 */
	public java.lang.String getAddress () {
		return address;
	}

	/**
	 * Set the value related to the column: address
	 * @param address the address value
	 */
	public void setAddress (java.lang.String address) {
		this.address = address;
	}



	/**
	 * Return the value associated with the column: linkman
	 */
	public java.lang.String getLinkman () {
		return linkman;
	}

	/**
	 * Set the value related to the column: linkman
	 * @param linkman the linkman value
	 */
	public void setLinkman (java.lang.String linkman) {
		this.linkman = linkman;
	}



	/**
	 * Return the value associated with the column: username
	 */
	public java.lang.String getUsername () {
		return username;
	}

	/**
	 * Set the value related to the column: username
	 * @param username the username value
	 */
	public void setUsername (java.lang.String username) {
		this.username = username;
	}



	/**
	 * Return the value associated with the column: password
	 */
	public java.lang.String getPassword () {
		return password;
	}

	/**
	 * Set the value related to the column: password
	 * @param password the password value
	 */
	public void setPassword (java.lang.String password) {
		this.password = password;
	}



	/**
	 * Return the value associated with the column: email
	 */
	public java.lang.String getEmail () {
		return email;
	}

	/**
	 * Set the value related to the column: email
	 * @param email the email value
	 */
	public void setEmail (java.lang.String email) {
		this.email = email;
	}



	/**
	 * Return the value associated with the column: phone
	 */
	public java.lang.String getPhone () {
		return phone;
	}

	/**
	 * Set the value related to the column: phone
	 * @param phone the phone value
	 */
	public void setPhone (java.lang.String phone) {
		this.phone = phone;
	}



	/**
	 * Return the value associated with the column: changes
	 */
	public java.util.Set<sdfi.lee.Entity.Change> getChanges () {
		return changes;
	}

	/**
	 * Set the value related to the column: changes
	 * @param changes the changes value
	 */
	public void setChanges (java.util.Set<sdfi.lee.Entity.Change> changes) {
		this.changes = changes;
	}

	public void addTochanges (sdfi.lee.Entity.Change change) {
		if (null == getChanges()) setChanges(new java.util.TreeSet<sdfi.lee.Entity.Change>());
		getChanges().add(change);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof sdfi.lee.Entity.User)) return false;
		else {
			sdfi.lee.Entity.User user = (sdfi.lee.Entity.User) obj;
			if (null == this.getId() || null == user.getId()) return false;
			else return (this.getId().equals(user.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}